package com.travelparadise.dao;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;

import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.travelparadise.domain.Commande;
import com.travelparadise.domain.Hotel;
import com.travelparadise.domain.Reservation;
import com.travelparadise.domain.Vol;

public class ReservationDaoHibernate extends HibernateDaoSupport  implements ReservationDao {

	public void addHotel(Hotel hotel) {
		// TODO Auto-generated method stub

	}

	@Override
	public void addVol(Vol vol) {
		// TODO Auto-generated method stub

	}

	@Override
	public Collection<Reservation> findReserveationsByIdCommande(int idCommande) {
		HibernateTemplate hibernateTemplate = this.getHibernateTemplate();
		Commande c = (Commande) hibernateTemplate.get("com.travelparadise.domain.Commande", idCommande);
		Collection<Reservation> r = (Collection<Reservation>) hibernateTemplate.find("select r from Reservation as r where r.commande.id="+c.getId());
		return r;
	}

}
